package cate.common.table.activity.powerdash.row;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import easy.java.dev.note.NoteField;

/**
 * @author liuyunke
 * @program: cate-game
 * @create
 * @description:
 */
public class PowerDashBaseRow extends ERow {
    @NoteField("每日触发次数")
    public int limit;
    @NoteField("持续时间")
    public int lastHour;
    @NoteField("冷却时间")
    public int coolHour;
    @NoteField("分组")
    public int group;
    @NoteField("邮件id")
    public int mailId;

    @Override
    public void parse(XSSFRowWrap xrw) {
        this.id = xrw.getInteger("ID");
        this.limit = xrw.getInteger("每日触发次数");
        this.lastHour = xrw.getInteger("持续时间");
        this.coolHour = xrw.getInteger("冷却时间");
        this.group = xrw.getInteger("分组");
        this.mailId = xrw.getInteger("邮件");
    }

    public long lastTime;
    public long coolTime;

    @Override
    public void decode() {
        this.lastTime = lastHour * 3600 * 1000L;
        this.coolTime = coolHour * 3600 * 1000L;
    }
}
